package h0910;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

/**
  * @description TODO
  * @author 不知名帅哥
  * @date 2024/9/10 18:16
  * @version 1.0
*/
public class LargestNum {
    public String largestNumber(int[] nums) {
        List<String> list=new ArrayList<>();
        for (int i = 0; i < nums.length; i++) {
            list.add(nums[i]+"");
        }
        list.sort((o1, o2) -> (o1+o2).compareTo(o2+o1));

        StringBuilder builder = new StringBuilder();
        for (String s : list) {
            builder.append(s);
        }
        return builder.toString();
    }
}
